package util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class TestConnection {
	private static Connection connect;
	//private static final String DRIVER = "com.mysql.jdbc.Driver" ;
	//private static final String URL = "jdbc:mysql56://localhost:3306/test";
	//private static final String USER = "root";
	//private static final String PASS = "ab1234CD";
	public  TestConnection()throws Exception{
		Class.forName("com.mysql.jdbc.Driver");
		System.out.println("Success loading Mysql Driver!");
		 connect = DriverManager.getConnection(
				 "jdbc:mysql://localhost:3306/test","root","ab1234CD");
		System.out.println("Success connect Mysql Driver!");
	}
	public Connection getConnection() throws Exception{
		return connect;
	}
	public void close()throws Exception{
		if(connect!=null){
			connect.close();
		}
	}
}
